<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue生命周期钩子函数</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" v-model="inputStr"/><br/>
        您输入的内容是：{{inputStr}}

        <button @click="dianji">点击</button>
        您点击的次数：{{count}}

    </div>
</body>
<script>
    new Vue({
        el:"#app",
        data:{
           inputStr:undefined,
           count:0,
           
        },
        methods: {
            dianji(){
              this.count++;
              
            },
            changeInputStr(){
                this.inputStr="1234";
            },
        },
        beforeCreate() {
            console.log("进入beforeCreate钩子")
            debugger
            
        },
        created() {
            console.log("进入created钩子")
            debugger
        },
        beforeMount() {
            console.log("进入beforeMount钩子")
            debugger
        },
        mounted() {
            console.log("进入mounted钩子")
            debugger
        },
        beforeUpdate() {
            console.log("进入beforeUpdate钩子")
        },
        updated() {
            this.changeInputStr();
            console.log("进入updated钩子")
        },
        beforeDestroy() {
            console.log("进入beforeDestroy钩子")
        },
        destroyed() {
            console.log("进入destroyed钩子")
        },

    });


</script>
</html>